package com.huwei.modules.base.config;

import feign.codec.Encoder;

import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 

/**
 * 	服务之间文件传输配置
 * @author Administrator
 *
 */
@Configuration
public class MultipartSupportConfig {
 
   @Autowired
   private ObjectFactory<HttpMessageConverters> messageConverters;
 
   @Bean
   public Encoder feignFormEncoder() {
      return new SpringMultipartEncoder(new SpringEncoder(messageConverters));
   }
}
